<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		var arr=[[2,1],[6,3,8,5],[6,7]];
		var temp;

		for(var i=0;i<arr.length;i++)
		{
			for(var j=i;j<arr[j].length;j++){
				if(arr[0]<arr[i]){
					temp=arr[i][j];
				}
			}
		}



			document.write(temp)
	</script>
</head>
<body>
</body>
</html>